var express = require('express');
var router = express.Router();
var query = require('./Database');
var path = require('path');
/* GET home page. */
router.get('/', function(req, res, next) {
    res.render('Yjingxuanqinpai', {});
});
router.post('/product',async (req,res)=>{
    // let rows = await query("select product.id,product.cartname,product.cartimgsrc,product,product.shopid,shop.shopname from product join shop where product.shopid = shop.id order by product.shopid");
    let rows = await query("select * from shop");
    let data = [{code:100},rows];
    res.send(data);
});

module.exports = router;